import { apiUrl }     from         '@/api/url';
import $http          from         '@/workers/util/http';
import { lang,isMobile }       from         '@/workers/util/http';

function getLang(){
    return new Promise(resolve => {
        function get(){
            if(lang){
                resolve(lang)
            }else{
                setTimeout(()=>{
                    get()
                },300)
            }
        }
        get();
    })
}
getLang().then(lang => {
    let timerGet = ()=>{
        if(process.env.PRODUCT_TYPE === 'partner' || isMobile()) return
        //获取币种分类配置
        $http.post(`${apiUrl.wapi}common/list-symbol-by-label`).then(res => {
            if(res && res.retCode === 0){
                postMessage({
                    type:'baseInfo',
                    action:'getSymbolByLabel',
                    value:res.retData
                })
            }
        });
        //现货币种列表
        //USDT永续币种列表
        //币本位合约币种列表
    }
    timerGet();
    setInterval(timerGet,5*60*1000);
})
